package com.java.demo;

import com.java.demo.model.ArticleInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;


@Order(10)
@Service
public class Articles {

    @Bean({"articleInfo","aaa"})
    public ArticleInfo getArticle() {
      ArticleInfo articleInfo = new ArticleInfo();
      articleInfo.setAid(1);
      articleInfo.setTitle("今天周几？");
      articleInfo.setContent("今天周一！");
      articleInfo.setCreatetime(LocalDateTime.now());
      return articleInfo;

    }

    @Bean({"articleInfo"})
    public ArticleInfo getArticle2() {
        ArticleInfo articleInfo = new ArticleInfo();
        articleInfo.setAid(1);
        articleInfo.setTitle("今天周几？");
        articleInfo.setContent("今天周二！");
        articleInfo.setCreatetime(LocalDateTime.now());
        return articleInfo;

    }
    public void sayHi() {
        System.out.println("Hi,Articles");
    }
}
